<?php

//服务器和数据库信息
$servername = "localhost";
$username = "root";
$password = "";
$dbName = "mysql";
$tableName = "user";


//create connection
$conn = new mysqli($servername, $username, $password, $dbName);

//check connection 
if ($conn->connect_error) {
  die('fail to connect' . $conn->connect_error);
}

$newpwd = md5('123456');
$sql = "UPDATE $tableName SET Password = '$newpwd' where User = 'koga'";

$result = $conn->query($sql);
var_dump($result);